package saa.dominio.usuario;

import java.io.Serializable;
import javax.persistence.Column;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import saa.dominio.periodo.OfertaDisciplina;

@Entity
@NamedQueries({
    @NamedQuery(name = "Moderador.id", query = "SELECT m FROM Moderador m WHERE m.id = :id"),
    @NamedQuery(name = "Moderadores", query = "SELECT m FROM Moderador m"),
    @NamedQuery(name = "Moderador.email", query = "SELECT m FROM Moderador m WHERE m.usuario.email = :email")})
public class Moderador implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private long id;

    @Column(nullable = false)
    @ManyToOne
    private Aluno aluno;

    @Column(nullable = false)
    @ManyToOne
    private OfertaDisciplina ofertaDisciplina;

    public Moderador() {
        super();
    }

    public Moderador(Aluno aluno, OfertaDisciplina ofertaDisciplina) {
        this.aluno = aluno;
        this.ofertaDisciplina = ofertaDisciplina;
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public Aluno getAluno() {
        return aluno;
    }

    public void setAluno(Aluno aluno) {
        this.aluno = aluno;
    }

    public OfertaDisciplina getOfertaDisciplina() {
        return ofertaDisciplina;
    }

    public void setOfertaDisciplina(OfertaDisciplina ofertaDisciplina) {
        this.ofertaDisciplina = ofertaDisciplina;
    }

}
